﻿using System.ComponentModel;
using System.ComponentModel.DataAnnotations;

namespace Mojito.Model
{
    /// <summary>
    ///  登录模型
    /// </summary>
    public class SignInInput
    {
        /// <summary>
        ///  身份凭据 用户名/手机号/邮箱
        /// </summary>
        [Required(ErrorMessage = "{0}不能为空")]
        [DisplayName("身份凭据")]
        public string Credential { get; set; }
        /// <summary>
        ///  口令
        /// </summary>
        [Required(ErrorMessage = "{0}不能为空")]
        [DisplayName("口令")]
        public string Password { get; set; }
        /// <summary>
        ///  图形验证码
        /// </summary>
        [DisplayName("图形验证码")]
        public string PictureCaptcha { get; set; }
        /// <summary>
        ///  短信验证码
        /// </summary>
        //[DisplayName("短信验证码")]
        //public string MessageCaptcha { get; set; }
    }

    /// <summary>
    ///  注册模型
    /// </summary>
    public class RegisterInput
    {
        /// <summary>
        ///  身份凭据 用户名/手机号/邮箱
        /// </summary>
        [Required(ErrorMessage = "{0}不能为空")]
        [DisplayName("身份凭据")]
        public string Credential { get; set; }
        /// <summary>
        ///  口令
        /// </summary>
        [Required(ErrorMessage = "{0}不能为空")]
        [DisplayName("口令")]
        public string Password { get; set; }
        /// <summary>
        ///  口令
        /// </summary>
        [Compare("Password")]
        [Required(ErrorMessage = "{0}不能为空")]
        [DisplayName("口令确认")]
        public string PasswordConfirm { get; set; }
        /// <summary>
        ///  手机
        /// </summary>
        [DisplayName("手机")]
        public string Phone { get; set; }
    }


    /// <summary>
    ///  登录用户信息输出
    /// </summary>
    public class UserInfoOutput
    {
        /// <summary>
        ///  用户Id
        /// </summary>
        public string Id { get; set; }
        /// <summary>
        ///  用户名
        /// </summary>
        public string Username { get; set; }
        /// <summary>
        ///  姓名
        /// </summary>
        public string Name { get; set; }
        /// <summary>
        ///  头像
        /// </summary>
        public string Photo { get; set; }
        /// <summary>
        ///  电话号码
        /// </summary>
        public string TelPhone { get; set; }
        /// <summary>
        ///  电子邮箱
        /// </summary>
        public string Email { get; set; }

        public UserInfoOutput() { }
        public UserInfoOutput(string id) { Id = id; }
    }

    /// <summary>
    ///  用户密码更新模型
    /// </summary>
    public class UpdatePasswordInput
    {
        /// <summary>
        ///  旧密码
        /// </summary>
        public string Password { get; set; }
        /// <summary>
        ///  新密码
        /// </summary>
        public string NewPassword { get; set; }
        /// <summary>
        ///  确认密码
        /// </summary>
        public string ConfirmPassword { get; set; }
    }
}
